﻿<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
    <title>日志查询界面</title>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/webjars/bootstrap/3.3.5/css/bootstrap.min.css"/>' />
    <link type="text/css" rel="stylesheet" href='<spring:url value="/webjars/bootstrap/3.3.5/css/bootstrap-theme.min.css"/>' />
    <link type="text/css" rel="stylesheet" href='<spring:url value="/resources/css/content.css"/>'/>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/resources/js/common/bootstrap-datetimepicker.min.css"/>'/>
    <script src='<spring:url value="/webjars/jquery/1.11.1/jquery.min.js"/>'></script>
    <script src='<spring:url value="/webjars/bootstrap/3.3.5/js/bootstrap.js"/>'></script>
    <script src='<spring:url value="/webjars/angularjs/1.5.5/angular.min.js"/>'></script>
    <script src='<spring:url value="/webjars/angularjs/1.5.5/angular-resource.js"/>'></script>
    <script src='<spring:url value="/webjars/bootbox/4.4.0/bootbox.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/bootstrap-datetimepicker.min.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/pageUtil.js"/>'></script>
    <script src='<spring:url value="/resources/js/log/LogModel.js"/>'></script>
    <script src='<spring:url value="/resources/js/log/LogService.js"/>'></script>
    <script src='<spring:url value="/resources/js/log/LogController.js"/>'></script>
</head>
<body ng-app="app" ng-controller="logCtrl">
    <div class="adcc-container">
        <ol class="breadcrumb">
            <li class="active">系统管理</li>
            <li class="active">日志查询</li>
        </ol>
        <form class="form-inline" method="post">
            <div class="form-group">
                <label class="control-label">日志级别</label>
                <select class="form-control" ng-model="searchLevel" ng-init="searchLevel=''">
                    <option value="" >--</option>
                    <option value="0">信息</option>
                    <option value="1">警告</option>
                    <option value="2">严重</option>
                    <option value="3">致命</option>
                </select>
                <div class="input-group date" data-provide="datepicker">
                    <input id="dateStart"type="datetime" class="datetimepicker" data-provide="datetimepicker-inline"  ng-model="searchDateStart" placeholder="开始时间" readonly>
                </div>
                <div class="input-group date" data-provide="datepicker">
                    <input id="dateEnd"type="datetime" class="datetimepicker" data-provide="datetimepicker-inline" ng-model="searchDateEnd" placeholder="结束时间" readonly>
                </div>
                <input id="queryKeyword" type="text" class="form-control" ng-model="queryKeyword" placeholder="日志内容查询关键字">
                <input id="queryOperateName" type="text" class="form-control" ng-model="queryOperateName" placeholder="查询用户">
                <button type="submit" ng-click="findByConditions()"  class="btn btn-primary">查询</button>
            </div>
        </form>

        <div style="overflow:auto">
          <table id="logTable" class="table table-bordered table-condensed table-hover" style="table-layout:fixed">
              <thead><tr>
                  <th style="width: 12%">时间</th>
                  <th style="width: 12%">用户</th>
                  <th style="width: 80%">日志</th>
              </tr></thead>
              <tbody>
              <tr id="logRow" ng-repeat="x in messages" ng-style="changColor(x.level)">
                  <td>{{x.createTime }}</td>
                  <td>{{x.name}}</td>
                  <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left;" data-toggle="tooltip" data-placement="top" title="{{x.log }}">{{x.log }}</td>
              </tr></tbody>
          </table>
        </div>

        <nav style="margin-top: 20px" class="form-inline">
            <ul class="pagination">
                <li id="top" class="input-group">
                    <a ng-click="firstPage()">
                        <span>首页</span>
                    </a>
                </li>
                <li id="previous" class="input-group">
                    <a ng-click="previous()">
                        <span>上一页</span>
                    </a>
                </li>
                <li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}" class="input-group">
                    <a ng-click="selectCurrentPage(page)" class="form-control">{{ page }}</a>
                </li>
                <li id="next" class="input-group">
                    <a ng-click="next()">
                        <span>下一页</span>
                    </a>
                </li>
                <li id="bottom" class="input-group">
                    <a ng-click="lastPage()">
                        <span>尾页</span>
                    </a>
                </li>
                <li class="input-group">
                    <%--可设置默认条数--%>
                    <select ng-model="selectPageSize" class="form-control" ng-init="selectPageSize='25'"
                            ng-change="changePageSize(selectPageSize)">
                        <option value="25">25</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                </li>
            </ul>
        </nav>
    </div>
</body>
</html>
